Automated variable dose oxygen treatment